using System;
using System.ComponentModel;
using System.Linq;

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ApiTest.Entitys
{
    /// <summary>
    /// 规格属性
    /// </summary>  
    /// <remarks>
    /// <![CDATA[ENGINE=InnoDB  COMMENT='规格属性']]>
    /// </remarks>
    [DbSource("Default"), Serializable]
    public class GoodsSpec
    {
        /// <summary>
        /// spec_id
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '']]>
        /// </remarks>
        [Primary(Automatic = true)]
        public int SpecId { get; set; }

        /// <summary>
        /// 图片规格
        /// </summary>
        /// <remarks>
        /// <![CDATA[bit(1) NOT NULL COMMENT '图片规格']]>
        /// </remarks>
        [Column(1, false)]
        [DisplayName("图片规格")]
        public bool IsImgSpec { get; set; }

        /// <summary>
        /// 规格名称
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(64) DEFAULT NULL COMMENT '规格名称']]>
        /// </remarks>
        [Column(64)]
        [DisplayName("规格名称")]
        public string SpecName { get; set; }

        /// <summary>
        /// 默认值组
        /// </summary>
        /// <remarks>
        /// <![CDATA[json DEFAULT NULL COMMENT '默认值组']]>
        /// </remarks>
        [Column]
        [DisplayName("默认值组")]
        public JToken DefaultValues { get; set; }

        /// <summary>
        /// 规格单位
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(8) DEFAULT NULL COMMENT '规格单位']]>
        /// </remarks>
        [Column(8)]
        [DisplayName("规格单位")]
        public string Unit { get; set; }

        /// <summary>
        /// remark
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(255) DEFAULT NULL COMMENT '']]>
        /// </remarks>
        [Column(255)]
        public string Remark { get; set; }

    }
}
